decide(Lean 4)
#Fleeting_Notes
decide(Lean 4)
Lean 4でDecidable型クラスのインスタンス(instance)を書いているものはいい感じに証明を進めれるようになっている
Decidableは命題に関する型クラス
Decidable Propositions (決定可能命題)
decideタクティクを書くと一気に証明が進む
code:memo
example : 10 < 5 ∨ 1 > 0 := by
decide
example : ¬ (True ∧ False) := by
decide
example : 10 * 20 = 200 := by
decide
theorem ex : True ∧ 2 = 1+1 := by
decide
#print ex
-- theorem ex : True ∧ 2 = 1 + 1 :=
-- of_decide_eq_true (Eq.refl true)
#check @of_decide_eq_true
-- ∀ {p : Prop} Decidable p, decide p = true → p
#check @decide
-- (p : Prop) → Decidable p → Bool
確認用
Q. decide(Lean 4)
関連
古典論理
DecidableEq
#guard
Lean コマンド
参考
型クラス - Theorem Proving in Lean 4 日本語訳
Decidable Propositions (決定可能命題) - Theorem Proving in Lean 4 日本語訳
メモ
Palindromes - Lean Manual
調査用
Google.icon decide Lean 4(日)
Google.icon decide lean 4(英)